﻿using System;
using System.Linq;
using System.Web.Security;
using Model.Entity;
using Ones.Dal.Repository.Impl;

namespace Ones.Wcf.SystemAdministration
{
    public class ServiceUserAuthentication : IServiceUserAuthentication
    {
        public bool UserAuthentiaction(string username, string password)
        {
            if (Membership.ValidateUser(username, password))
            {
                return true;
            }
            return false;
        }

        public string UserRole(string username)
        {
            return Roles.GetRolesForUser(username)[0];
        }

        public ViewMembershipUserEmployee getUser(string username)
        {
            IMembershipUserEmployeeDao mue = new MembershipUserEmployeeDao();
            return mue.getUser(username);
        }
    }
}